package com.qc.ds.controller.backstage;

import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.qc.ds.pojo.AdminInfo;
import com.qc.ds.services.UserInfoService;
import com.qc.ds.util.Const;


@Controller
@RequestMapping("/manager/userInfo/")
public class UserInfoController {
	@Autowired
	private UserInfoService userInfoService;
	/**
	 * @date 2017年8月4日) 下午6:58:58
	 * @Package com.qc.ds.controller.backstage 
	 * @Description: TODO//用户登录
	 */
	@RequestMapping( value="userLogin", method=RequestMethod.POST)
	public String userLogin(String userLoginAccount,String userLoginPassWord,HttpSession session,Map<String, Object> map ) {
	AdminInfo userInfo =	userInfoService.findUserLogin(userLoginAccount, userLoginPassWord);
		if(null== userInfo ){
			map.put("msg", "账号或密码错误！");
			return "login";
		}else{
			session.setAttribute(Const.USER_INFO, userInfo);
			//调用查询类别
			return "redirect:../category/findCategory";
		}

	}
}